<?php


/**
 * 邮箱SMTP配置
 * Enter description here ...
 * @author Admin
 *
 */
class SmtpAction extends CommonAction{
	
	
	/**
	 * 邮箱配置列表首页
	 * Enter description here ...
	 */
	public function index() {
		$smtp = D('Smtp');
		$smtpdata = $smtp->findAll();   //获取所有
		
		$this->assign("smtpdata",$smtpdata);
		$this->display();
	}
	
	
	/**
	 * 新建邮箱配置保存
	 * @see CommonAction::insert()
	 */
	public function insert(){
		$data = Init_GP(array('name','password','mail','smtp','port','auth','ssl','state'));
		parent::insert($data);
	}
	
	
	
	/**
	 * 修改邮箱配置保存
	 * @see CommonAction::update()
	 */
	public function update(){
		$id = GetNum($_POST['id']);  //主键
		
		$map['id'] = array('eq',$id);
		$data = Init_GP(array('name','password','mail','smtp','port','auth','ssl','state'));
		
		parent::update($data,$map);
	}
	
	
}
?>